package com.ywk.pattern._14_observer._14_2;

import java.util.ArrayList;
import java.util.List;

public class Secretary {
    //同事列表
    private List<StockObserver> observerList = new ArrayList<StockObserver>();
    private String action;

    //增加
    public void Attach(StockObserver observer) {

        observerList.add(observer);
    }

    //通知
    public void Notify() {
        for (StockObserver stockObserver : observerList) {
            stockObserver.Update();
        }
    }
    //前台状态


    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }
}
